package org.galaxyworld.flycode.config;

import java.util.List;

public class JdbcConfigData extends ConfigData {

    private String driver;

    private String userName;

    private String password;

    private String url;

    private List<String> prefixList;

    private boolean includePrefix;

    @Override
    public void load(ConfigFile configFile) {
        driver = configFile.getString("jdbc.driver");
        url = configFile.getString("jdbc.url");
        userName = configFile.getString("jdbc.username");
        password = configFile.getString("jdbc.password");
        prefixList = configFile.getStringList("jdbc.prefix");
        includePrefix = configFile.getBoolean("java.includePrefix");
    }

    public String getDriver() {
        return driver;
    }

    public String getUserName() {
        return userName;
    }

    public String getPassword() {
        return password;
    }

    public String getUrl() {
        return url;
    }

    public List<String> getPrefixList() {
        return prefixList;
    }

    public boolean isIncludePrefix() {
        return includePrefix;
    }

    public void setDriver(String driver) {
        this.driver = driver;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public void setUrl(String url) {
        this.url = url;
    }

    public void setPrefixList(List<String> prefixList) {
        this.prefixList = prefixList;
    }

    public void setIncludePrefix(boolean includePrefix) {
        this.includePrefix = includePrefix;
    }

    @Override
    public String getName() {
        return "jdbc";
    }
}
